<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.hhwy.sso.client.filter.SessionUtil" %>
<%@taglib prefix="shiro"  uri="/WEB-INF/ac.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="${Config.staticURL}plugins/miniui/boot.js" type="text/javascript"></script>
    <script type="text/javascript"src="${Config.staticURL}/lib/jquery/jquery.min.js"></script>
    <link rel="stylesheet" href="${Config.staticURL}plugins/miniui/table.css">
    <script src="${Config.basePath}plugins/miniui/fileupload/js/ajaxfileupload.js" type="text/javascript"></script>
    <title> -详细</title>
</head>

<body class="body">
<form action="" id="form1">
    <div
            style="padding: 2px; border-bottom: 0; border: none; margin-top: 10px; background-color: #fff;">

        <table style="width: 100%; border: none;">
            <tr>

                <td style="width: 100%;"></td>
                <td style="white-space: nowrap;">



                  <shiro:hasPermission name="M0103-edit">
                     <a
                        class="mini-button" iconCls="icon-edit" id="edit" onclick="editData()"
                        plain="true">修改</a>
                      <span class="separator" id="s1"></span>
                   </shiro:hasPermission>

                    <shiro:hasPermission name="M0103-delete">
                        <a class="mini-button" iconCls="icon-remove" id="delete" onclick="confirmDelete()"
                           plain="true">删除</a>
                         <span class="separator" id="s2"></span>
                    </shiro:hasPermission>
                    
                    <shiro:hasPermission name="M0103-commit">
                     <a class="mini-button" iconCls="icon-node" id="commit" onclick="startProcess()"
                                           plain="true">提交</a>
                             <span class="separator" id="s3"></span>
                     </shiro:hasPermission>
                     
                    <a
                        class="mini-button" iconCls="icon-undo" id="return" onclick="goBack()"
                        plain="true">返回</a>


                </td>
            </tr>
        </table>
    </div>
    <table border="0" align="center" cellpadding="0" cellspacing="0" class="tab_form">
        <TBODY>
	        <tr>
	            <td class="title" colspan="4">
	              	  -详细	              	  
	            </td>
	            <input id="id" name="id" class="mini-textbox" style="display:none;"/>
	        </tr>
 			<tr>
					<td class="l">
	              		address
	            </td>
				<td class="r">
				          <input id="address" name="address"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	birthday
		        </td>
				<td class="r">
	        			<input id="birthday" name="birthday"allowInput="false" class="mini-datepicker mini-textbox asLabel"/>
			
				            </td>
	    	</tr>
	    	
	    	
 			<tr>
					<td class="l">
	              		code
	            </td>
				<td class="r">
				          <input id="code" name="code"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	email
		        </td>
				<td class="r">
	        			
	          <input id="email" name="email"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
					<td class="l">
	              		idcard
	            </td>
				<td class="r">
				          <input id="idcard" name="idcard"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	loginName
		        </td>
				<td class="r">
	        			
	          <input id="loginName" name="loginName"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
					<td class="l">
	              		mobile
	            </td>
				<td class="r">
				          <input id="mobile" name="mobile"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	password
		        </td>
				<td class="r">
	        			
	          <input id="password" name="password"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
					<td class="l">
	              		photo
	            </td>
				<td class="r">
				          <input id="photo" name="photo"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	qq
		        </td>
				<td class="r">
	        			
	          <input id="qq" name="qq"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
					<td class="l">
	              		sex
	            </td>
				<td class="r">
				          <input id="sex" name="sex"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	tel
		        </td>
				<td class="r">
	        			
	          <input id="tel" name="tel"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	
 			<tr>
					<td class="l">
	              		userName
	            </td>
				<td class="r">
				          <input id="userName" name="userName"allowInput="false" class="mini-textbox asLabel"/>
	         	            </td>
				<td class="l">
		            	wx
		        </td>
				<td class="r">
	        			
	          <input id="wx" name="wx"allowInput="false" class="mini-textbox asLabel"/>
	          	            </td>
	    	</tr>
	    	
	    	

        </TBODY>
    </table>
</form>

<script type="text/javascript">
	var basePath = '${Config.baseURL}';
    mini.parse();
    var form = new mini.Form("#form1");

  //取得跳转的参数 返回JSON格式
    function getRequestArgs() {
        var url = location.search;
        //获取url中"?"符后的字串
        var args = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");

            for (var i = 0; i < strs.length; i++) {
                args[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
            }
        }
        return args;
    }

	//详细页面初始化表单数据
    $.ajax({
        url: "${Config.basePath}user/"+ getRequestArgs()["id"],
        type: "get",
        async: false,
        success: function (text) {
        console.log(text);
            var data = mini.decode(text);   //反序列化成对象
            form.setData(data);             //设置多个控件数据
        }
    });
    
    
	//删除数据
    function confirmDelete() {
        mini.confirm("确定删除记录吗？", "警告",
            function (action) {
                if (action == "ok") {
                    var url = "${Config.basePath}user/" + getRequestArgs()["id"];
			        $.ajax({
			            url: url,
			            contentType: "application/json;charset=UTF-8",
			            type: "delete",
			            async: false,
			            success: function (text) {
			                goBack();
			            },
			            error: function (jqXHR, textStatus, errorThrown) {
			            	mini.alert("发生异常，删除数据失败");
			            }
			        });
                } else {
                
                }
            }
        );
    }
    
    //跳转修改页面
    function editData() {
        window.location.href = "${Config.basePath}/view/epc/user/userEdit?id=" + getRequestArgs()["id"];

    }
    //返回：跳转列表页面
    function goBack() {
        window.location.href = "${Config.basePath}/view/epc/user/userList";
    }
</script>
</body>
</html>